package com.tjy.wfx.controller;

import com.tjy.wfx.model.WxbCustomer;
import com.tjy.wfx.service.WxbCustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/customer")
public class WfxCustomerController {
    @Autowired //注入商户service
    private WxbCustomerService wxbCustomerService;

    @RequestMapping("/initCustomer")
    public String findAll(Model model){
        //查询所有商户信息
       List<WxbCustomer> sysCustomerList =wxbCustomerService.findAll();
       //携带数据返回页面
        model.addAttribute("customerList",sysCustomerList);
        return "customer-list";
    }
}
